The present invention relates to a moving image coding device that analyzes images, which were input, prior to coding of the images that were input to take a coding control based on this analysis result, a moving image coding method, and a program thereof, and more particular to a moving image coding device that smoothes fluctuating generation code quantity by a coding buffer under a fixed bit rate, and outputs coding data at a fixed rate, a moving image coding method, and a program thereof.
As a coding method employing a pre-analysis, is known the method disclosed in J-P-66067/1998.
In said method, prior to making a coding for the images, analysis was made for the images that were input beforehand, and, after a complexity degree of each image was computed, target code quantity was calculated according to a ratio of complexity of said image to a total complexity degree.
A configuration of the moving image coding device will be explained.
FIG. 25 is a diagram illustrating a configuration of the moving image coding device employing the pre-analysis.
As shown in FIG. 25, the moving image coding device is configured of pre-analysis means 901, target code quantity computation means 1010, quantization controlling means 1001, moving image coding means 1002, and delay means 902.
The pre-analysis means 901 is means for measuring the complexity degree of each image with pre-encoding or extraction of statistics.
According to a ratio of the complexity of the above image to the degree indicating the total complexity of a certain constant interval analyzed in the pre-analysis means 901, the target code quantity computation means 1010 calculates the target code quantity of the images, by assigning to the above image a constant ratio of the code quantity that can be assigned to all images of a certain constant interval.
The delay means 902 is means for delaying supply of said input images to main coding means 1000 until the target code quantity of the above image is determined.
The quantization controlling means 1001 is means for computing a quantization scale from the assigned code quantity.
The moving image coding means 1002 is means for coding the images so that the code quantity, which is generated as a result of having coded the images that were delayed by the delay means 902, becomes the target code quantity calculated in the target code quantity computation means 1010.
Next, an operation of the above-mentioned configuration will be explained.
FIG. 26 is a diagram illustrating an operation of the moving image coding device employing the pre-analysis.
As shown in FIG. 26, when an image j is coded, the images of L frames are pre-analyzed with the pre-analysis means 901 to compute a complexity degree of each image, based on this analysis result. And, the target code quantity computation means 1010 calculates the target code quantity of only the image j, based on the complexity degrees computed in the pre-analysis means 901. The moving image coding means 1002 codes the image j so that the code quantity becomes the target code quantity calculated in the target code quantity computation means 1010. In such a manner, the art is generally known of assigning the code quantity much more to the images that need the code quantity than to the images that do not need the code quantity too much, by making an analysis for the images prior to making a coding for the images to allocate the code quantity to the images according to the complexity degree obtained by this analysis result.
But, no consideration was given to a transition of buffer occupancy brought by the assignment of the code quantity, whereby the defects existed: In performing the actual coding process, failures of the buffer such as an overflow or an underflow were brought about in the buffer. Even if the process for avoiding the failures of the buffer was built-in in performing the actual coding process, the code quantity, which is generated in coding the images, results in having deviated from the assigned target code quantity, and the code quantity control after generation comes to be not able to be taken exactly.
Further, in the event that the process for avoiding the failures of the buffer was performed, the different code quantity from the code quantity, which was originally to be assigned, resulted in being assigned and the defect existed that deterioration in coded images was brought about.